/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *                                                                  *
 *        *************************************************         *
 *        *©2021-2027 HT Corporation All rights reserved *          *
 *        *************************************************         *
 *                                                                  *
 * FileName    : h_vi.h                                             *
 *                                                                  *
 * Author      : linus                                              *
 *                                                                  *
 * Email       : luoyaojun@haitutech.com                            *
 *                                                                  *
 * Date        : 2022-8-9                                           *
 *                                                                  *
 * Description :                                                    *
 *                                                                  *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef __H_VI_H
#define __H_VI_H

#include "h_register.h"
#include "ht_vi.h"

#define HT_MPP_HANDLE_VI (struct ht_vi *)HT_MPP_HANDLE(HT_ID_VI)


struct ht_vi{
    HT_MOD_ID m_id;
    struct ht_vi_ops *ops;
};

struct ht_vi_ops{
	
	HT_S32 (*vi_get_connecion_info)(struct ht_vi *pvi, struct ht_vi_connection_info *conn_info);
    HT_S32 (*vi_dev_init)(struct ht_vi *pvi, HT_S32 viDev);
    HT_S32 (*vi_dev_exit)(struct ht_vi *pvi, HT_S32 viDev);
    HT_S32 (*vi_chn_init)(struct ht_vi *pvi, HT_S32 viDev, HT_S32 viChn, struct ht_vi_config *);
    HT_S32 (*vi_chn_get_frame)(struct ht_vi *pvi, HT_S32 viPipe, HT_S32 viChn, HT_S32 wait_time, ht_vi_get_frame_cb cb, void *user);
    HT_S32 (*vi_chn_stop_frame)(struct ht_vi *pvi, HT_S32 viPipe, HT_S32 viChn);
    HT_S32 (*vi_chn_exit)(struct ht_vi *pvi, HT_S32 viDev, HT_S32 viChn);

	HT_U64 (*vi_frame_get_pts)(struct ht_vi *pvi, HT_FRAME frame);
	//	frame to memory address

	//	vi chn freeze

	//	vi chn set user picture

	//	vi enable user picture

	//	vi disable user picture

	//	vi suspend

	//	vi resume
};

HT_S32 ht_vi_modules_register(struct ht_vi *pvi);
#endif
